var $$scope;
function uploadFile($scope, $route, CertusFormAjax, CertusJsonAjax, $location, $http, $cookies,$routeParams){
    $$scope = $scope;
    var fileInstantiation = {
        fileSuperClass : "CP"

    }
    var fileInstantiationDisable = {
        classCateCodeDis : true, //文件类目不可修改
        fileClassCodeDis : true //文件类型不可修改
    }
    //调用初始化方法
    initFileUpload($scope, fileInstantiation,fileInstantiationDisable , CertusFormAjax);
    
    $scope.outerUploadFile = function () {
        fileUpload($scope,function (res){
            $scope.product.fileId = res.data;
            CertusJsonAjax.ajax("productFileSave", $scope.product, function (res) {
                if(res.data){
                    if(res.data == "success"){
                        window.history.back();
                    }
                }
            });
        },null,CertusFormAjax);
    }

    $scope.productChangeName = function(a){
        var regex = /[0-9]*/g;
        var numList = a.match(regex);

        if (a != "") {
            CertusFormAjax.ajax("relatedProduct", {name: a}, function (res) {
                $scope.productSelect = res.data;
            });
        }
    }
}
